//    Copyright (C) Kherty.  All rights reserved.
using System.Diagnostics;
using OpenLS.Core.Serialization;
using System.Diagnostics.Contracts;

namespace OpenLS.Spreadsheet
{
    class ExternalReference : IOfficeXmlSerializable
    {
        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (ReadContext c = context.Read("externalReference"))
            {
                Id = c.GetString(OfficeConstants.RelationshipNamespace + "id");
                Contract.Assert(Id != null);
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("externalReference"))
            {
                c.SetString(OfficeConstants.RelationshipNamespace + "id", Id);
            }
        }

        #endregion
        private string id;

        public string Id
        {
            get { return id; }
            set { id = value; }
        }

    }
}
